﻿/*
#------------------------------------------------------------------------------
#-- Program Name:	[dbo].[fnConfig_GetPasswordHash]
#-- Purpose:		Return the password hash for a login
#--	Last Update:	10/06/2016
#--					For a complete history - please review comments in Version
#--					control.
#------------------------------------------------------------------------------
*/
CREATE FUNCTION [dbo].[fnConfig_GetPasswordHash]
(
	@loginName varchar(256)
)
RETURNS varchar(1024)
WITH EXECUTE AS OWNER
AS
BEGIN
	--- Return the Answer to the Question
	RETURN	ISNULL(CONVERT(varchar(1024), LOGINPROPERTY(@loginName, 'PASSWORDHASH'), 1), '')
END
